
/**
** \file       exec_shcmd.c
**
** \brief      this function execute shell command rule
**
** \author     Ben M'rad Hanna, Laterem Hamza, Boillot Ulysse, De Olivera
**             Guillaume and Nguyen Viet Dung
**
** \version    1.0
**
** \date       28 November 2010
**
*/

#include "execution.h"

int             exec_shcmd(s_sh_cmd     *node)
{

  if (node->cmpdlist != NULL)
    return (exec_cmpdlist(node->cmpdlist));

  if (node->rulefor != NULL)
    return (exec_for(node->rulefor));

  if (node->ruleif != NULL)
    return (exec_if(node->ruleif));

  if (node->ruleuntil != NULL)
    return (exec_until(node->ruleuntil));

  if (node->rulecase != NULL)
    return (exec_case(node->rulecase));

  if (node->rulewhile != NULL)
    return (exec_while(node->rulewhile));

  return (1);
}
